home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_perl.idb / usr / freeware / catman / p_man / cat3 / IO::Pipe.Z / IO::Pipe
Encoding:
Text File  |  1998-10-28  |  3.2 KB  |  133 lines

  1.  
  2.  
  3.  
  4.      IIIIOOOO::::::::PPPPiiiippppeeee((((3333))))     22223333////JJJJuuuullll////99998888 ((((ppppeeeerrrrllll 5555....000000005555,,,, ppppaaaattttcccchhhh 00002222))))       IIIIOOOO::::::::PPPPiiiippppeeee((((3333))))
  5.  
  6.  
  7.  
  8.      NNNNAAAAMMMMEEEE
  9.       IO::pipe - supply object methods for pipes
  10.  
  11.      SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.           use IO::Pipe;
  13.  
  14.           $pipe    = new IO::Pipe;
  15.  
  16.           if($pid = fork()) { #    Parent
  17.               $pipe->reader();
  18.  
  19.               while(<$pipe> {
  20.               ....
  21.               }
  22.  
  23.           }
  24.           elsif(defined    $pid) {    # Child
  25.               $pipe->writer();
  26.  
  27.               print $pipe ....
  28.           }
  29.  
  30.           or
  31.  
  32.           $pipe    = new IO::Pipe;
  33.  
  34.           $pipe->reader(qw(ls -l));
  35.  
  36.           while(<$pipe>) {
  37.               ....
  38.           }
  39.  
  40.  
  41.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  42.       IO::Pipe provides an interface to createing pipes between
  43.       processes.
  44.  
  45.      CCCCOOOONNNNSSSSTTTTRRRRCCCCUUUUTTTTOOOORRRR
  46.       new (    [READER, WRITER] )
  47.           Creates a    IO::Pipe, which    is a reference to a newly
  48.           created symbol (see the Symbol package). IO::Pipe::new
  49.           optionally takes two arguments, which should be objects
  50.           blessed into IO::Handle, or a subclass thereof. These
  51.           two objects will be used for the system call to pipe. If
  52.           no arguments are given then method handles is called on
  53.           the new IO::Pipe object.
  54.  
  55.           These two    handles    are held in the    array part of the GLOB
  56.           until either reader or writer is called.
  57.  
  58.      MMMMEEEETTTTHHHHOOOODDDDSSSS
  59.  
  60.  
  61.  
  62.  
  63.      Page 1                        (printed 10/23/98)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      IIIIOOOO::::::::PPPPiiiippppeeee((((3333))))     22223333////JJJJuuuullll////99998888 ((((ppppeeeerrrrllll 5555....000000005555,,,, ppppaaaattttcccchhhh 00002222))))       IIIIOOOO::::::::PPPPiiiippppeeee((((3333))))
  71.  
  72.  
  73.  
  74.       reader ([ARGS])
  75.           The object is re-blessed into a sub-class    of IO::Handle,
  76.           and becomes a handle at the reading end of the pipe. If
  77.           ARGS are given then fork is called and ARGS are passed
  78.           to exec.
  79.  
  80.       writer ([ARGS])
  81.           The object is re-blessed into a sub-class    of IO::Handle,
  82.           and becomes a handle at the writing end of the pipe. If
  83.           ARGS are given then fork is called and ARGS are passed
  84.           to exec.
  85.  
  86.       handles ()
  87.           This method is called during construction    by
  88.           IO::Pipe::new on the newly created IO::Pipe object. It
  89.           returns an array of two objects blessed into
  90.           IO::Pipe::End, or    a subclass thereof.
  91.  
  92.      SSSSEEEEEEEE AAAALLLLSSSSOOOO
  93.       the _I_O::_H_a_n_d_l_e manpage
  94.  
  95.      AAAAUUUUTTTTHHHHOOOORRRR
  96.       Graham Barr <bodg@tiuk.ti.com>
  97.  
  98.      CCCCOOOOPPPPYYYYRRRRIIIIGGGGHHHHTTTT
  99.       Copyright (c)    1996 Graham Barr. All rights reserved. This
  100.       program is free software; you    can redistribute it and/or
  101.       modify it under the same terms as Perl itself.
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.      Page 2                        (printed 10/23/98)
  130.  
  131.  
  132.  
  133.